<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div class="easyui-layout" fit="true">
  <div region="center" style="padding:0px;border:0px">
  	<div class="searchPanel">
   		<input placeholder="输入学号或用户名查询" id='searchInput' maxlength="15"> <button class="searchBtn"  onclick="search()">查询</button>
   	</div>
  </div>
</div>

<style>
	.searchPanel{
		margin: auto;
	    margin-top: 20%;
	    width: 350px;
	}
	
	#searchInput {
		border:1px solid #ddd !important;
		color:black;
		font-size:20px;
		padding: 10px;
	}
	
	.searchBtn{
		font-size:18px;
		padding-top: 12px;
   		padding-bottom: 10px;
   		padding-left:20px;
   		padding-right:20px;
	}
	
</style>
 
<script type="text/javascript">
	 $(document).ready(function(){
	 	$('#searchInput').focus();
	 	
	 	$('#searchInput').keypress(function(e){
	 		 if(e.which == 13) {  
	 			search();
	 		 }
	 	});
	 }); 
	 
	 function search(){
		 var no = $('#searchInput').val();
		 $.ajax({
			 url:"studentAccountController/validateStuNo.do?no="+no,
			 success:function(d){
				 d = $.parseJSON(d);
				 if(!d.success){
					 tip("没有查询到账号信息，请核实后重新输入！")
				 }else{
					 showChargeWindow(no);
				 }
			 }
		 })
	 }
	 
	 function showChargeWindow(no){
		 var addurl = 'studentAccountController.do?showChargeWin&no='+no;
		  $.dialog({
			  	id:'charge',
				content: 'url:'+addurl,
				lock : true,
				zIndex: 1000, 
				width:500,
				height:250,
				title:'账户充值', 
				opacity : 0.3,
				cache:false, 
			    cancelVal: '关闭',
			    cancel: true /*为true等价于function(){}*/
			});
	 }
</script>